import Vue from 'vue'
import Router from 'vue-router'
import Home from 'views/home/home.vue'
import Category from 'views/category/category.vue'
import Profile from 'views/profile/profile.vue'
import Detail from 'views/detail/detail.vue'
import Cart from 'views/cart/cart.vue'
Vue.use(Router)
const routes = [
  {
    // 路由重定向
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/category',
    component: Category
  },
  {
    path: '/profile',
    component: Profile
  },
  {
    path: '/detail',
    component: Detail
  },
  {
    path: '/cart',
    component: Cart
  }
]
const router = new Router({
  mode: 'history',
  routes
})
export default router
